package com.tech.platform.cms.databases.mybatis.sqlParser.tenantParser.exception;

/**
 * @author shengqiang.wu
 * @date 2019/12/26/026 11:02
 * @desc
 */
public class NullTenantException extends Exception{

    private Throwable cause = null;

    public NullTenantException() {
        super();
    }

    public NullTenantException(String arg0) {
        super(arg0);
    }

    public NullTenantException(Throwable arg0) {
        this.cause = arg0;
    }

    public NullTenantException(String arg0, Throwable arg1) {
        super(arg0);
        this.cause = arg1;
    }

    @Override
    public Throwable getCause() {
        return cause;
    }

    @Override
    public void printStackTrace() {
        printStackTrace(System.err);
    }

    @Override
    public void printStackTrace(java.io.PrintWriter pw) {
        super.printStackTrace(pw);
        if (cause != null) {
            pw.println("Caused by:");
            cause.printStackTrace(pw);
        }
    }

    @Override
    public void printStackTrace(java.io.PrintStream ps) {
        super.printStackTrace(ps);
        if (cause != null) {
            ps.println("Caused by:");
            cause.printStackTrace(ps);
        }
    }
}
